package com.aispeech.asr.clib.vad;

import com.sun.jna.Library;
import com.sun.jna.ptr.IntByReference;
import com.sun.jna.ptr.PointerByReference;

public interface IVad extends Library {
    long vad_new(String config, int isBin);
    long vad_split_new(String config, int isBin);

    void vad_delete(long instance);
    void vad_split_delete(long instance);

    void vad_reset(long instance);
    void vad_split_reset(long instance);

    int vad_start(long instance, String json, int bytes);
    int vad_split_start(long instance, String json, int bytes);

    int vad_feed(long instance, int state, byte[] data, int bytes);
    int vad_split_feed(long instance, byte[] data, int bytes);

    int vad_end(long instance);
    int vad_split_stop(long instance, PointerByReference result, IntByReference resultLen);

    int vad_flush(long instance);

    int vad_register_handler(long instance,
                             long usr_data,
                             IVadNotifyCallback notifyCallback,
                             long usr_data2,
                             IVadDataCallback dataCallback);
    
    int vad_register_speech_data_handler(long instance,
            long usr_data,
            IVadDataCallback dataCallback);
}
